{% load static %}

<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8">
        <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css" />
        <script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>
        <script src="http://cdn.bootcss.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
        <link rel="stylesheet" type="text/css" href="{% static 'css/per_center.css' %}"/>
		<title>个人中心</title>
	</head>
	<body>
		<div class="navigation">
				<img src="{% static 'img/LOGOOOO.png' %}" class="Logo">
				<a href="{% url 'Home_Page' %}" class="before">寻物启事</a>
				<a href="{% url 'Second_Page' %}" class="before">失物招领</a>
				<a href="{% url 'publish' %}" class="before">发布帖子</a>
				<a href="{% url 'about' %}" class="last">关于</a>
                <a href="{% url 'per_center' %}" class="last">个人中心</a>
		</div>
		<div class="per_center">
            <div class="user_info">个人信息</div>
            <div class="picture">
                {% if not picture %}
			        <img src="{% static 'img/OIP-C.jpg' %}">
                {% else %}
                    <img src="/media/{{ picture.user_picture }}">
                {% endif %}
            </div>
            <a href="/head_picture/">点击更换头像</a>
			<div class="content">
				<p>昵称：<br>{{ user.user_name }}</p>
				<p>id：<br>{{ user.user_id }}</p>
			</div>
		</div>
		<div class="release public_container">
            <div class="my_publish">我的发布</div>
            <h2 class="typ">寻物启示：</h2>
            {% if not o_objects %}
                <div style="line-height: 50px;text-align: center">您还没有发布过哦！</div>
            {% endif %}
            {% for o_object in o_objects %}
			<div class="box" onclick="window.open('/Home_detail?id={{ o_object.o_number }}','_self')">
				<img src="/media/{{ o_object.o_picture1 }}" alt="图片" class="pictures">
					<ul>
						<li>物品名称：{{ o_object.o_name }}</li>
						<li>物品分类：{{ o_object.o_classification }}</li>
                        <li>物品详情：{{ o_object.o_detail }}</li>
					</ul>
                <div><a href="/o_delete?object_id={{ o_object.o_number }}">删除</a></div>
			</div>
			{% endfor %}
            <h2 class="typ">失物招领：</h2>
            {% if not r_objects %}
                <div style="line-height: 50px;text-align: center">您还没有发布过哦！</div>
            {% endif %}
            {% for r_object in r_objects %}
			<div class="box" onclick="window.open('/Second_detail?id={{ r_object.r_number }}','_self')">
				<img src="/media/{{ r_object.r_picture1 }}" alt="图片" class="pictures">
					<ul>
						<li>物品名称：{{ r_object.r_name }}</li>
                        <li>物品分类：{{ r_object.r_classification }}</li>
						<li>物品详情：{{ r_object.r_detail }}</li>
					</ul>
                <div><a href="/r_delete?object_id={{ r_object.r_number }}">删除</a></div>
			</div>
            {% endfor %}
            <!-- Button trigger modal -->
            <div class="login_out">
            <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">
             退出登录
            </button>
            </div>
            <!-- Modal -->
            <div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel"style="top: 200px" aria-hidden="true">
              <div class="modal-dialog">
                <div class="modal-content">
                  <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel"><br>温馨提示</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                      <span aria-hidden="true">&times;</span>
                    </button>
                  </div>
                  <div class="modal-body">
                      是否确认退出登录！
                  </div>
                  <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
                    <a href="{% url 'login_out' %}" type="button" class="btn btn-primary">确认退出</a>
                  </div>
                </div>
              </div>
            </div>
		</div>
	</body>
</html>
